import store from '@/store';
import { DirectiveBinding } from 'vue';

/** 权限指令 待优化 */
export const auth = (el: any, binding: DirectiveBinding<any>) => {
  if (!store.state.user.userInfo?.power.includes(binding.value + '')) {
    const comment = document.createComment('no permission');
    el.parentNode && el.parentNode.replaceChild(comment, el);
  }
};
